%{--
This file is part of dbdjasperreport.

Copyright (C) 2008 Kue Vang aka Kou
Licensed under the Eclipse Public License, Version 1.0; 
you may not use this file except in compliance with the License. 
You may obtain a copy of the License at http://www.eclipse.org/legal/epl-v10.html 
Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an "AS IS" BASIS, 
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
See the License for the specific language governing permissions and limitations 
under the License.
--}%

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
        <title>Report List</title>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="create">New Report</g:link></span>
        </div>
        <div class="body">
            <h1>Report List</h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                   	        <g:sortableColumn property="id" title="Id" />
                        
                   	        <th>System</th>
                   	    
                   	        <g:sortableColumn property="reportName" title="Report Name" />
                        
                   	        <g:sortableColumn property="reportTitle" title="Report Title" />
                        
                   	        <g:sortableColumn property="showReport" title="Show Report" />
							
							<g:sortableColumn property="dateCreated" title="Date Created" />
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${reportList}" status="i" var="report">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${report.id}">${report.id?.encodeAsHTML()}</g:link></td>
                        
                            <td>${report.reportSystem?.encodeAsHTML()}</td>
                        
                            <td>${report.reportName?.encodeAsHTML()}</td>
                        
                            <td>${report.reportTitle?.encodeAsHTML()}</td>
                            <td>${report.showReport?.encodeAsHTML()}</td>
							
							<td>
								<g:dateFormat value="${report?.dateCreated}" format="MM/dd/yyyy"/>
							</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <g:paginate total="${Report.count()}" />
            </div>
        </div>
    </body>
</html>
